package main

import "gitee.com/dreamwood/ez-maker/maker"

func Buyer() {
	c := maker.CreateTable("Buyer", "买方", "crm")
	c.AddName()
	c.AddManyToOne("cat", "分类", "BuyerCategory")
	c.AddText("short", "缩写")
	c.AddText("info", "简介")
	c.AddText("note", "备注")
	c.AddText("address", "地址")
	c.AddText("contact", "联系方式")
	c.AddArt("detail", "详情")
	c.AddFile("cover", "封面")
	c.AddFiles("assets", "附件")

	c.AddOneToMany("files", "备忘录", "BuyerFile")

	c.AddCreateAt()
	c.AddUpdateAt()
	c.AddDelete()
	c.Generate()
}

func BuyerFile() {
	c := maker.CreateTable("BuyerFile", "备忘录", "crm")
	c.AddManyToOne("buyer", "主体", "Buyer")
	c.AddManyToOne("cat", "分类", "FileCategory")
	c.AddName()
	c.AddSort()
	c.AddArt("content", "详情")
	c.AddFiles("assets", "附件")
	c.Generate()
}
